﻿using System.Linq;
using System.Xml.Serialization;
using ElectronicCommerce.Framework.Configuration.Attributes;

namespace ElectronicCommerce.Framework.Web.Configuration.Resource
{
    [ConfigFile("~/Configuration/Site/Css.config", ConfigPathType.ServerPath)]
    [XmlRoot("cssStyles", Namespace = WebConfigurationNamespaces.NAMESPACE_SITE)]
    public class CssConfiguration
    {
        [XmlElement("css")]
        public CssCollection CssCollection { get; set; }

        public Css GetCss(string name)
        {
            return CssCollection.Where(c => c.Name.ToLower() == name.ToLower()).SingleOrDefault();
        }
    }
}
